package com.easy.easybook.service.impl.base;

import com.easy.easybook.dao.base.BaseDao;
import com.easy.easybook.service.base.IService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author http://zouyujie.top
 * @date 2021/12/19 11:46
 */
public class ServiceImpl<M extends BaseDao<T>, T> implements IService<T> {
    @Autowired
    M baseDao;

    @Override
    public List<T> selectAll() {
        return baseDao.listAll();
    }

    @Override
    public int save(T t) {
        return baseDao.add(t);
    }

    @Override
    public int delete(Integer id) {
        return baseDao.delete(id);
    }

}
